<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Modifica Escursione</title>
</h:head>

<h:body>
	#{EscursioneBean.setEscursioneById(param.ide)}
	<h:form id="edit">
		<input type="hidden" name="ide" value="#{EscursioneBean.escursione.id}"/>
		<p:panel header="Modifica Escursione">
			<h:panelGrid id="grid" columns="4" cellpadding="5"> 
			
			 	<h:outputLabel for="nome" value="Nome Escursione: " /> 
			 	<p:inputText id="nome" value="#{EscursioneBean.escursione.nome}" required="true" label="Nome"/>
			 	<p:message for="nome" />
			 	<h:outputText value="" />
			 		
			 	<h:outputLabel for="descrizione" value="Descrizione: "/>
			 	<p:inputTextarea rows="10" cols="50" id="descrizione" value="#{EscursioneBean.escursione.descrizione}" required="true" label="Descrizione">
					<f:validateLength minimum="5" /> 
				</p:inputTextarea>
				<p:message for="descrizione" />
				<h:outputText value="" />
				
				<h:outputLabel for="luogo" value="Luogo Escursione: " /> 
			 	<p:inputText id="luogo" value="#{EscursioneBean.escursione.luogo}" required="true" label="Luogo">
			 		<f:validateLength minimum="3" /> 
			 	</p:inputText>
			 	<p:message for="luogo" />
			 	<h:outputText value="" />
						
				<h:outputLabel for="costo" value="Costo "/>
				<p:inputText id="costo" value="#{EscursioneBean.escursione.costo}" required="true" label="Costo">
					<f:validateDoubleRange minimum="1" maximum="32000" />  
				</p:inputText>
				<p:message for="costo" />
				<h:outputText value="" />		
			</h:panelGrid>
	
			<p:commandButton  update="grid" icon="ui-icon-check" validateClient="true" style="margin-right:10px"
			type="submit" value="Modifica" action="#{EscursioneBean.modificaEscursione()}"/>
                 
            <br></br>
            <br></br>
            
            <p:commandButton type="submit" id="cancelE" value="Cancella" action="#{EscursioneBean.cancellaEscursione()}">
                 <p:confirm header="Confirmation" message="Sicuro di voler cancellare l Escursione?" icon="ui-icon-alert" />  
    		</p:commandButton>  
    		
    		<p:confirmDialog global="true" showEffect="fade" hideEffect="explode">  
        		<p:commandButton value="Si" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check"/>  
        		<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close"/>       
    		</p:confirmDialog>  
		</p:panel>
	</h:form>
</h:body>
</html>